<?php
/***************************************************************************
                                  Class3.php
                              -------------------
  
        A PHP5 class used as a reference to test constants parsing. 

 **************************************************************************/

/**
 * Constants declared in a group.
 *
 * All constant statements in groups must be on a single line, this is a 
 * format which suits well constants defined as a serie.
 *
 * The inline comments are used to document constant individualy, these
 * subcomments are optional.
 *
 * Use the # inline comment to get subcomment ignored for documenting. 
 */
define("CLAS_ONE", 1);    // case flag ONE
define("CLAS_TWO", 2);    // case flag TWO
define("CLAS_THREE", 3);  # this comment should not appear in documentation

/**
 * Long string constant.
 *
 * Individual constant comment provides long description for every constant,
 * while in group, constant must be declared in single line each.
 *
 * @experimental
 * @type string
 */
define("CLAS_ERRMSG", "A classical error message " . 
                      "which stands onto three " . 
                      "lines to be defined ; and a semi-colon.");
                      
/**
 * Constant declared with single documenting.
 *
 * @warning a warning for parsing test
 */
define("CLAS_CON", 1024);
                      

/**
 * Constants can be declared in a group with no single comment.
 */
define("CLAS_GROUP2_ONE", 21); 
// Comment to break the "nice" group (ignored by Mdoc parser)
define("CLAS_GROUP2_TWO", 22); 
// Another comment ignored by Mdoc parser
define("CLAS_GROUP2_THREE", 23);

/**
 * A nasty constant declaration.
 *
 * Placing an inline comment in a strange place.
 */
       // what an idea to place a comment here!
define (   
           "STRANGE", true
       ); 

/**
 * Class to test constant parsing.
 *
 * This class presents a lot of constant declaration statements to test
 * most of parsing possibilities.
 */
class Class3 {

/**
 * A "member" constant for parsing tests.
 *
 * As of PHP5, constant can be declared in a class, with the new "const"
 * statement and is accessed with class member syntax even within the class
 * itself. Their scope is global assuming to use class member syntax.
 *
 * [code]
 * // A class constant is accessed with class member syntax
 * class Test {
 *
 *   const HELLO = "Hello world!";
 *
 *   function __construct() {
 *     echo Test::HELLO;  // even within the class
 *   }
 * }
 * // Accessing the class constant in global scope
 * echo Test::HELLO;
 */
const START = 0;  // this comment is ignored by the Mdoc parser

/**
 * New line chars.
 *
 * @warning  These constants are referred to as Class3::NL_DOS, 
 *           Class3::NL_MAC, Class3::NL_NIX
 */
const NL_DOS = "\r\n";  // for Windows environment
const NL_MAC = "\r";    // for Mac environment
const NL_NIX = "\n";    // for Unix/Linux environment

/**
 * Odd/even test masks.
 *
 * @experimental
 */
const MASK_ODD = 1;   // use this constant to test if value is odd
const MASK_EVEN = 2;  // use this constant to test if value is even

/**
 * Very simple method.
 *
 * This class is kept very simple to facilitate the constants parsing
 * test.
 *
 * @return (void) 
 */
function hello() {

  echo "Hello world!";
}
}
?>
